package com.bjsxt.usersCenter.users.pojo;

import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.bjsxt.usersCenter.system.pojo.ARegion;

/**
 * users的pojo
 * @author Administrator
 */
public class AUsers
{
	private int id;
	private int regionId;
	private String email;
	private String password;
	private String phone;
	private String qq;
	private String address;
	private int loginFailedCount;
	private Date loginFailedTime;
	private String photoPath;
	private byte emailStatus;
	private byte phoneStatus;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;
	
	
	private String statusStr;
	private String emailStatusStr;
	private String phoneStatusStr;
	
	
	private AUsersExtend usersExtend;
	private ARegion region;
	
	
	
	public int getId()
	{
		return id;
	}
	public void setId(int id)
	{
		this.id = id;
	}
	public String getEmail()
	{
		return email;
	}
	public void setEmail(String email)
	{
		this.email = email;
	}
	public String getPassword()
	{
		return password;
	}
	public void setPassword(String password)
	{
		this.password = password;
	}
	public String getPhone()
	{
		return phone;
	}
	public void setPhone(String phone)
	{
		this.phone = phone;
	}
	public String getQq()
	{
		return qq;
	}
	public void setQq(String qq)
	{
		this.qq = qq;
	}
	public String getAddress()
	{
		return address;
	}
	public void setAddress(String address)
	{
		this.address = address;
	}
	public int getLoginFailedCount()
	{
		return loginFailedCount;
	}
	public void setLoginFailedCount(int loginFailedCount)
	{
		this.loginFailedCount = loginFailedCount;
	}
	public Date getLoginFailedTime()
	{
		return loginFailedTime;
	}
	public void setLoginFailedTime(Date loginFailedTime)
	{
		this.loginFailedTime = loginFailedTime;
	}
	public String getPhotoPath()
	{
		return photoPath;
	}
	public void setPhotoPath(String photoPath)
	{
		this.photoPath = photoPath;
	}
	public byte getEmailStatus()
	{
		return emailStatus;
	}
	public void setEmailStatus(byte emailStatus)
	{
		this.emailStatus = emailStatus;
	}
	public byte getPhoneStatus()
	{
		return phoneStatus;
	}
	public void setPhoneStatus(byte phoneStatus)
	{
		this.phoneStatus = phoneStatus;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getUpdateTime()
	{
		return updateTime;
	}
	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}
	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}
	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}
	public JSONObject toJSON()
	{
		// TODO Auto-generated method stub
		return null;
	}
	public AUsersExtend getUsersExtend()
	{
		return usersExtend;
	}
	public void setUsersExtend(AUsersExtend usersExtend)
	{
		this.usersExtend = usersExtend;
	}
	public String getStatusStr()
	{
		
		AUsersEnum[] usersEnums=AUsersEnum.values();
		for (int i = 0; i < usersEnums.length; i++)
		{
			AUsersEnum usersEnum=usersEnums[i];
			
			if(usersEnum.toString().startsWith("STATUS_"))
			{
				if(usersEnum.getStatus()==this.getStatus())
				{
					
					this.statusStr=usersEnum.getInfo();
					
					break;
				}
			}
			
			
		}
		
		
		
		return statusStr;
	}
	public String getEmailStatusStr()
	{
		AUsersEnum[] usersEnums=AUsersEnum.values();
		for (int i = 0; i < usersEnums.length; i++)
		{
			AUsersEnum usersEnum=usersEnums[i];
			
			if(usersEnum.toString().startsWith("EMAILSTATUS_"))
			{
				if(usersEnum.getStatus()==this.getEmailStatus())
				{
					
					this.emailStatusStr=usersEnum.getInfo();
					
					break;
				}
			}
			
			
		}
		
		
		
		return emailStatusStr;
	}
	public String getPhoneStatusStr()
	{
		
		
		AUsersEnum[] usersEnums=AUsersEnum.values();
		for (int i = 0; i < usersEnums.length; i++)
		{
			AUsersEnum usersEnum=usersEnums[i];
			
			if(usersEnum.toString().startsWith("PHONESTATUS_"))
			{
				if(usersEnum.getStatus()==this.getStatus())
				{
					
					this.phoneStatusStr=usersEnum.getInfo();
					
					break;
				}
			}
			
			
		}
		
		return phoneStatusStr;
	}
	public int getRegionId()
	{
		return regionId;
	}
	public void setRegionId(int regionId)
	{
		this.regionId = regionId;
	}
	public ARegion getRegion()
	{
		return region;
	}
	public void setRegion(ARegion region)
	{
		this.region = region;
	}
	@Override
	public String toString()
	{
		return "AUsers [id=" + id + ", regionId=" + regionId + ", email=" + email + ", password=" + password
				+ ", phone=" + phone + ", qq=" + qq + ", address=" + address + ", loginFailedCount=" + loginFailedCount
				+ ", loginFailedTime=" + loginFailedTime + ", photoPath=" + photoPath + ", emailStatus=" + emailStatus
				+ ", phoneStatus=" + phoneStatus + ", status=" + status + ", createTime=" + createTime + ", updateTime="
				+ updateTime + ", lastLoginTime=" + lastLoginTime + ", statusStr=" + statusStr + ", emailStatusStr="
				+ emailStatusStr + ", phoneStatusStr=" + phoneStatusStr + ", usersExtend=" + usersExtend + ", region="
				+ region + "]";
	}
	
	
	
	
	
}
